package com.sxbbc.common.core.enums;

import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * 推送类型枚举类
 *
 * @author leehao
 * @date 2019-06-14
 */
public enum PushTypeEnums {
    CASH_NOTICE("push_001", "提现通知"),
    ORDER_NOTICE("push_002", "订单通知"),
    REFUND_NOTICE("push_003", "退款通知"),
    EVENT_NOTICE("push_004","事件行为"),
    PLAT_NOTICE("push_005","平台通知"),
    SECKILL_NOTICE("push_006", "秒杀通知");

    private String id;
    private String name;

    PushTypeEnums(String id, String name) {
        this.id = id;
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getName(String id) {
        String str = "";
        for (PushTypeEnums o : PushTypeEnums.values()) {
            if (StringUtils.equals(id, o.getId())) {
                str = o.getName();
                break;
            }
        }
        return str;
    }

    public static List<PushTypeEnums> queryList() {
        List<PushTypeEnums> list = new ArrayList<PushTypeEnums>();
        for (PushTypeEnums o : PushTypeEnums.values()) {
            list.add(o);
        }
        return list;
    }
}
